package com.xiaohu.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaohu.common.dao.Tourist;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface TouristMapper extends BaseMapper<Tourist> {

    @Update("UPDATE tourist SET total = total + 1 WHERE tourist_name = #{touristName}")
    public Integer touristTotalAddOneByTouristName(@Param("touristName") String touristName);

    @Select("select total from tourist where tourist_name = #{touristName}")
    public Integer selectTouristTotal(@Param("touristName") String touristName);

    @Update("UPDATE `tourist` SET total = 0")
    public Integer touristTotalEmpty ();
}
